package Servlet;

import entity.User;
import service.UserServiceImp;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;



//

@WebServlet("/addResp")
public class ServletAddOne extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        resp.setContentType("text/html;charset-utf-8");
        resp.setHeader("content-type","text/html;charset=utf-8");
        UserServiceImp userServiceImp = new UserServiceImp();

        List<User> deptId = userServiceImp.getDeptId();
        req.setAttribute("attrDeptList",deptId);

        req.getRequestDispatcher("/userAdd.jsp").forward(req,resp);
    }
}
